package com.macro.mall.service.impl;

import com.macro.mall.mapper.TenantUserServiceMapper;
import com.macro.mall.model.TenantUserEntity;
import com.macro.mall.service.TenantUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  商家用户信息实现
 *
 * @author zhang
 * @date 2021/06/19
 */
@Service
public class TenantUserServiceImpl implements TenantUserService {
    @Autowired
    private TenantUserServiceMapper tenantUserServiceMapper;

    @Override
    public List<TenantUserEntity> findTenanUserList(Long tenantId, Integer curPage,Integer pageSize) {
        Integer skip = (curPage-1)*pageSize;
        List<TenantUserEntity> tenanUserList = tenantUserServiceMapper.findTenanUserList(tenantId, skip, pageSize);
        return tenanUserList;
    }

    @Override
    public int findTenanUserCount(Long tenantId) {
        return tenantUserServiceMapper.findTenanUserNum(tenantId);
    }
}
